home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-11-30 | 4.2 KB | 109 lines | [TEXT/MPS ] |
- * File IntEnv.a
- *
- * Copyright Apple Computer, Inc. 1986 - 1988
- * All rights reserved.
- *
- * Include File for Accessing the Integrated Environment Libraries
-
- * Set CASE OBJECT to assure references to the names IMPORTed here link
- * properly. The following statements restore the CASE setting to its
- * previous value.
-
- PRINT Push,Off ; save current print settings and turn it off
- GBLC &S%%%,&P%%%
- &S%%% SETC &Setting('CASE') ; save current CASE setting
- &P%%% SETC &Setting('PRINT',1) ; and PRINT settings before we changed them
-
- MACRO
- X%%%
- GBLC &S%%%,&P%%% ; link references with previously defined variables
- PRINT Push,&P%%% ; restore the previous PRINT settings
- CASE &S%%% ; and restore the CASE setting
- PRINT POP ; restore the PRINT settings
- ENDM
-
- PRINT Pop ; restore the PRINT settings
- CASE OBJECT ; all imported/exported names case significant
-
- * Integrated Environment Globals
-
- IMPORT StandAlone ; a long, 0 if in shell, 1 if standalone
- IMPORT errno ; a long, error number; set on unsuccessful I/O calls
- IMPORT MacOSErr ; a word; set along with errno if appropriate
-
- * Integrated Environment Routines
-
- IMPORT _DataInit ; called for you by _RTInit
- IMPORT _RTInit ; your tool MUST call this routine on startup
- IMPORT _RTExit ; Does NOT return
- IMPORT getenv
- IMPORT IEGETENV
- IMPORT atexit
- IMPORT exit
- IMPORT _exit
- IMPORT faccess
- * cmd values for faccess
- * F_OPEN EQU (('d'<<8)|00) ; for internal use only
- * 'd' => "directory" ops; available for any program
- F_DELETE EQU (('d'<<8)|01) ; deletes filename
- F_RENAME EQU (('d'<<8)|02) ; renames file to string pointed to by arg
- * 'e' => "editor" ops; available to programs running under MPW
- F_GTABINFO EQU (('e'<<8)|00) ; arg is address of long, has tab offset
- F_STABINFO EQU (('e'<<8)|01) ; arg is address of long, new tab offset
- F_GFONTINFO EQU (('e'<<8)|02) ; arg is address of long, has font info
- F_SFONTINFO EQU (('e'<<8)|03) ; arg is address of long, new font info
- ; high order-font number; low-font size
- F_GPRINTREC EQU (('e'<<8)|04) ; arg is handle to print record TPrint
- F_SPRINTREC EQU (('e'<<8)|05) ; arg sets handle to print record TPrint
- F_GSELINFO EQU (('e'<<8)|06) ; arg is address of selection record
- F_SSELINFO EQU (('e'<<8)|07) ; arg is address of selection record
- F_GWININFO EQU (('e'<<8)|08) ; arg is address of a rect
- F_SWININFO EQU (('e'<<8)|09) ; arg is address of a rect
-
- IMPORT open
- * mode values for open call
- O_RDONLY EQU 0
- O_WRONLY EQU 1
- O_RDWR EQU 2
- * auxiliary mode flags for open call (one of above plus zero or more from this list)
- O_APPEND EQU (1<<3) ; when writing, seek to EOF before each write
- O_RSRC EQU (1<<4) ; open the resource fork
- O_CREAT EQU (1<<8) ; create file if it doesn't exist
- O_TRUNC EQU (1<<9) ; truncate file to zero size
- * only valid with O_CREAT specified
- O_EXCL EQU (1<<10) ; if O_CREAT is set, open will fail if file exists
- * predefined file descriptors for standard input, standard output, and diagnostic output
- InputFD EQU 0
- OutputFD EQU 1
- DiagnosticFD EQU 2
-
- IMPORT close
- IMPORT read
- IMPORT write
- IMPORT ioctl
- * selector values for ioctl calls
- * FIOLSEEK EQU (('f'<<8)|00) ; internal use only
- * FIODUPFD EQU (('f'<<8)|01) ; internal use only
- FIOINTERACTIVE EQU (('f'<<8)|02) ; returns 0 if interactive, -1 if not
- FIOBUFSIZE EQU (('f'<<8)|03) ; Arg is address of long, returns the optimal
- ; buffer size for this device
- FIOFNAME EQU (('f'<<8)|04) ; Arg is address of filename associated with fd
- FIOREFNUM EQU (('f'<<8)|05) ; Arg is address of short, returns fd's refnum
- FIOSETEOF EQU (('f'<<8)|06) ; Set file length to long in arg
- TIOFLUSH EQU (('t'<<8)|00) ; throw away terminal input
-
- IMPORT lseek
- * mode values for lseek
- fromStart EQU 0
- fromCurPos EQU 1
- fromEnd EQU 2
-
- IMPORT fcntl
- * argument to fcntl
- F_DUPFD EQU 0
-
-
- PRINT Push,Off ; save and turn off PRINT when macro is invoked
- X%%% ; invoke the macro to restore CASE setting
- PRINT POP ; restore the PRINT settings
-